package highlight_spring4.web.ch4_5;

import highlight_spring4.domain.DemoObj;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;

/**
 * @ClassName ConverterController
 * @Package highlight_spring4.web.ch4_5
 * @Description TODO
 * @Author zjb
 * @Date 2018/7/25 16:42
 * @Version 1.0
 **/
@Controller
public class ConverterController {
    //指定返回的媒体类型为我们自定义的媒体类型application/x-wisely.
    @RequestMapping(value = "convert",produces = {"application/x-wisely"})
    public @ResponseBody DemoObj convert(@RequestBody DemoObj demoObj){
        return demoObj;
    }
}
